﻿/*
drop table mailsharp_message_queue;
drop table mailsharp_recipient_queue;
drop table mailsharp_message_archive;
drop table mailsharp_recipient_archive;
*/

create table mailsharp_message_queue
(
  id int not null auto_increment,
  from_name varchar(255) not null,
  from_email varchar(255) not null,
  sender varchar(255) null,
  reply_to varchar(255) null,
  subject varchar(255) not null,
  html_body longtext not null,
  plain_text_body longtext not null,
  start_send_date_time datetime not null,
  primary key (id) 
);

create table mailsharp_recipient_queue
(
  id int not null auto_increment,
  message_id int not null,
  to_name varchar(255) not null,
  to_email varchar(255) not null,
  merge_values longtext null,
  primary key (id)
);
  
create table mailsharp_message_archive
(
  id int not null auto_increment,
  from_name varchar(255) not null,
  from_email varchar(255) not null,
  sender varchar(255) null,
  reply_to varchar(255) null,
  subject varchar(255) not null,
  html_body longtext not null,
  plain_text_body longtext not null,
  primary key (id)
);

create table mailsharp_recipient_archive
(
  id int not null auto_increment,
  message_id int not null,
  to_name varchar(255) not null,
  to_email varchar(255) not null,
  merge_values longtext null,
  success tinyint(1) default 0,
  send_date_time datetime not null,
  primary key (id) 
);
